<script setup lang="ts">
import MathCanvas from '@/components/MathCanvas.vue';
import { onMounted, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const mathFormula = ref<string>('')
// 组件挂载完毕
// onMounted(() => {
//   mathFormula.value = '$$ a^2 - \frac{1}{2} $$'
//   console.log('父组件公式：', mathFormula)
// })
// 页面加载
onLoad(async () => {
  console.log('子组件页面加载')
  // mathFormula.value = '?x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.?'
  mathFormula.value =
    '\\displaystyle \\frac{1}{\\Bigl(\\sqrt{\\phi \\sqrt{5}}-\\phi\\Bigr) e^{\\frac25 \\pi}} = 1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}} {1+\\frac{e^{-8\\pi}} {1+\\cdots} } } }'
  mathFormula.value = '$$D. x^{2+y} + x=1'
  console.log('父组件公式：', mathFormula.value)
})
</script>

<template>
  <view>
    <MathCanvas :mathFormula="mathFormula"></MathCanvas>
  </view>
</template>

<style lang="scss"></style>
